package com.hoas.comparedb.pojo;

import java.util.Objects;

public abstract class DiffItem<T> {

    private T nt;

    private T ot;

    private String key;

    private String type;

    public DiffItem(T ot, T nt) {
        this.ot = ot;
        this.nt = nt;
    }

    public T getOt() {
        return ot;
    }


    public T getNt() {
        return nt;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DiffItem<?> that = (DiffItem<?>) o;
        return Objects.equals(key, that.key);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key);
    }
}
